import { BaseWindow } from "../../../../component/window/BaseWindow";
import { ILayer } from "../../../../mvc/interfaces/ILayer";
import { ObjCreate } from "../../common/ObjCreate";
import { ImagesConst } from "../../../resource/ImagesConst";
import { ArenaCrossFightRecordCellRenderer } from "./cell/ArenaCrossFightRecordCellRenderer";
import { SArenaCrossFightRecords } from "../../../../../Message/Public/SArenaCrossFightRecords";
import { DataProvider } from "../../../../../fl/data/DataProvider";
import { GTileList } from "../../../../../com/mui/controls/GTileList";
//class ArenaCrossSelectVideoWindow
    
    export  class ArenaCrossSelectVideoWindow extends BaseWindow
    {
        constructor(arg1: ILayer=null)
        {
            super(arg1);
            setSize(660, 278);
            title = "比赛结果";
            titleHeight = 26;
            return;
        }

        protected /* override */ createChildren(): void
        {
            super.createChildren();
            ObjCreate.createBg(18, 37, 623, 233, this);
            this._bmpVS = ObjCreate.createBitmap(ImagesConst.ArenaVS, 316, 43);
            this.addChild(this._bmpVS);
            this._tileList = ObjCreate.createTileList(30, 60, 600, 192, this);
            this._tileList.columnWidth = 600;
            this._tileList.rowHeight = 64;
            this._tileList.setStyle("cellRenderer", ArenaCrossFightRecordCellRenderer);
            return;
        }

        public updateRecords(arg1: SArenaCrossFightRecords): void
        {
            this._tileList.dataProvider = new DataProvider(arg1.fightRecords);
            this._tileList.drawNow();
            return;
        }

        public static hasInstance(): Boolean
        {
            return !(ArenaCrossSelectVideoWindow._instance == null);
        }

        public static get instance(): ArenaCrossSelectVideoWindow
        {
            if (!ArenaCrossSelectVideoWindow._instance) 
            {
                ArenaCrossSelectVideoWindow._instance = new ArenaCrossSelectVideoWindow();
            }
            return ArenaCrossSelectVideoWindow._instance;
        }

        /* internal */ /* var */_bmpVS: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_tileList: GTileList;

        /* internal */ static /* var */_instance: ArenaCrossSelectVideoWindow;
    }
